<template>
  <div class="footer">
    <div class="footer-service">
      <div class="container">
        <div class="footer-list">
          <Dkhs v-for="(item, index) in dkhsItems" :key="index" :dkhsData="item"/>
        </div>
      </div>
    </div>
    <div class="container">
      <div class="footer-links">
        <div class="footer-links-title">
          <span>购物指南</span>
          <span>配送方式</span>
          <span>支付方式</span>
          <span>售后服务</span>
          <span>特色服务</span>
        </div>
        <div class="footer-links-content">
          <div class="link-column" v-for="(group, index) in footerLinks" :key="index">
            <ul>
              <li v-for="(link, idx) in group.links" :key="idx">{{ link }}</li>
            </ul>
          </div>
        </div>
      </div>
    </div>

    <div class="footer-bottom">
      <div class="container">
        <p>© 2023 京东 JD.com 版权所有</p >
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import Dkhs from './Dkhs.vue';

const dkhsItems = ref([
  {
    img: require("../assets/duo.png"),
    desc: '品类齐全,轻松购物'
  },
  {
    img: require("../assets/duo.png"),
    desc: '多仓直发,极速配送'
  },
  {
    img: require("../assets/duo.png"),
    desc: '正品好货,精致服务'
  },
  {
    img: require("../assets/duo.png"),
    desc: '天天低价,畅选无忧'
  }
]);

const footerLinks = ref([
  {
    title: '购物指南',
    links: ['购物流程', '会员介绍', '生活旅行', '常见问题', '大家电', '联系客服']
  },
  {
    title: '配送方式',
    links: ['上门自提', '211限时达', '配送服务查询', '配送费收取标准']
  },
  {
    title: '支付方式',
    links: ['货到付款', '在线支付', '分期付款', '公司转账']
  },
  {
    title: '售后服务',
    links: ['售后政策', '价格保护', '退款说明', '返修/退换货', '取消订单']
  },
  {
    title: '特色服务',
    links: ['夺宝岛', 'DIY装机', '延保服务', '京东卡', '京东通信', '京鱼座智能']
  }
]);
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  display: flex;
  justify-items: center;
  align-items: center;
  width: 80%;
  max-width: 1190px;
  margin: 0 auto;
}

/* 顶部导航条样式 */

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  height: 100%;
  font-size: 12px;
}

.left-nav ul, .right-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  align-items: center;
}

.left-nav li, .right-nav li {
  margin-right: 10px;
  color: #999;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 5px;
}

.right-nav li:last-child {
  margin-right: 0;
}

.left-nav li:hover, .right-nav li:hover {
  color: #e1251b;
}

/* 头部搜索区域样式 */

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  max-width: 100%;
  height: auto;
  max-height: 40px;
}

.search input {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 15px;
  font-size: 13px;
}

.search button {
  height: 100%;
  width: 80px;
  background-color: #e1251b;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
}

.keywords ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.keywords li {
  margin-right: 10px;
  font-size: 12px;
  color: #999;
  cursor: pointer;
}

.keywords li:hover {
  color: #e1251b;
}

/* 主体内容区域样式 */

.main-content .container {
  display: flex;
  gap: 10px;
}

/* 左侧分类导航样式 */

.category-nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item:hover .category-title span {
  color: red;
}

.category-title span {
  margin-right: 5px;
}

.sub-list a {
  font-size: 12px;
  color: #666;
  margin-right: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.sub-list a:hover {
  color: #e1251b;
}

/* 中间内容区域样式 */

.navigation ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.navigation li {
  margin-right: 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.navigation li:hover {
  color: #e1251b;
}

.product-price span {
  font-size: 14px;
  font-weight: bold;
  color: #e1251b;
}

.item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 右侧信息栏样式 */

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-tips img {
  width: 40px;
  height: 40px;
  margin-right: 5px;
}

.service-tips span {
  font-size: 12px;
  color: #999;
}

.user-link-item img {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.user-link-item span {
  font-size: 12px;
  color: #666;
}

.plus-info p, .enterprise-info p {
  font-size: 12px;
  color: #996e35;
  margin: 0;
}

.enterprise-info p {
  color: #3b6a9d;
}
 .container {
  width: 80%;
  max-width: 1190px;
  margin: 0 auto;
}

.footer {
  width: 100%;
  background-color: #fff;
  padding-bottom: 30px;
  border-top: 1px solid #e5e5e5;
  margin-top: 50px;
}

.footer-service {
  width: 100%;
  background-color: #f8f8f8;
  border-bottom: 1px solid #e5e5e5;
}

.footer-list {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 15px 0;
  width: 100%;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  border-bottom: 1px solid #e5e5e5;
}

.footer-links-title {
  display: flex;
  justify-content: space-around;
  padding: 15px 0;
  border-bottom: 1px solid #e5e5e5;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.footer-links-title span {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  text-align: center;
  padding: 0 15px;
}

.footer-links-content {
  display: flex;
  justify-content: space-around;
  padding-top: 15px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.link-column {
  text-align: center;
  padding: 0 15px;
}

.link-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-column li {
  font-size: 12px;
  color: #666;
  line-height: 28px;
  cursor: pointer;
  white-space: nowrap;
}

.link-column li:hover {
  color: #e1251b;
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #e5e5e5;
  margin-top: 20px;
}

.footer-bottom .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-bottom p {
  font-size: 12px;
  color: #999;
}
</style>